home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / GCC 1.37.1r14 / usr / gcc-1.37.1r14 / object oriented files / GNUStaticPane.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-29  |  3.1 KB  |  98 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2.  GNUStaticPane.c
  3.  
  4. A superclass of CAbstractText, with functionality similar to CEditPane in static
  5. text mode, but does
  6. not make use of textedit, so can handle arbitrary size buffers.
  7.  
  8. Body of Draw, CalcLineStarts, IndexToLine methods 
  9. Incorporate code originally written by
  10. Roy Wood 122 Britannia Avenue London, Ontario, Canada N6H 2J5
  11.  
  12. Brazenly hacked for TCL compatibility by Jonathan Kimmitt.
  13.  
  14. The many bugs introduced during this process are entirely my fault
  15.  
  16. */
  17.  
  18.  
  19. #pragma once
  20.  
  21. #include "CAbstractText.h"                /* Interface for its superclass        */
  22.  
  23. class GNUStaticPane : public CAbstractText {        /* Class Declaration                */
  24.  
  25. public:
  26.                                 /** Instance Variables **/
  27.     long        spacingCmd;        /* Line spacing command number        */
  28.     long        alignCmd;        /* alignment cmd number                */
  29.  
  30.                                 /** Instance Methods **/
  31.                                     /** Contruction/Destruction **/
  32.     virtual void         IGNUStaticPane(CView *anEnclosure, CBureaucrat *aSupervisor);
  33.     virtual void        Dispose(void);
  34.  
  35.     virtual void        Draw(Rect *area);
  36.  
  37.     virtual void        Scroll( long hDelta, long vDelta, Boolean redraw);
  38.  
  39.     virtual void        GetSteps(short *hStep, short *vStep);            // TCL 1.1.3 11/30/92 BF
  40.  
  41.                                     /** Text Specification **/
  42.     virtual void        SetTextPtr(Ptr textPtr, long numChars);
  43.     virtual Handle        GetTextHandle(void);
  44.  
  45.     virtual void        ResizeFrame(Rect *delta);
  46.     virtual void        AdjustBounds(void);
  47.     
  48.     virtual long        FindLine( long charPos);
  49.     virtual long        GetLength( void);
  50.  
  51.                                     /** Text Characteristics **/
  52.     virtual void        SetFontNumber(short aFontNumber);
  53.     virtual void        SetFontStyle(short aStyle);
  54.     virtual void        SetFontSize(short aSize);
  55.     virtual void        SetTextMode(short aMode);
  56.  
  57.     virtual void        SetSpacingCmd( long aSpacingCmd);
  58.     virtual void        GetGNUTEFontInfo(FontInfo *macFontInfo);
  59.     virtual void        GetTextStyle( short *whichAttributes, TextStyle *aStyle);
  60.     virtual void         GetCharStyle( long charOffset, TextStyle *theStyle);
  61.     virtual long        GetSpacingCmd( void);
  62.     virtual long        GetAlignCmd( void);
  63.                                     /** Printing **/
  64.     virtual void        PrintPage(short pageNum, short pageWidth, short pageHeight, CPrinter *aPRinter);
  65.  
  66.     virtual void        GetExtent(long        *theHExtent,long        *theVExtent);
  67.     virtual long        GetHeight(long startLine, long endLine);
  68.     virtual    void        GetSelection(long *selStart, long *selEnd);
  69.     virtual long         GetCharOffset( LongPt *aPt);
  70.     virtual void         GetCharPoint( long offset, LongPt *aPt);
  71.     virtual void         TypeChar(char theChar, short theModifers);
  72.     virtual void         SetSelection( long selStart, long selEnd, Boolean fRedraw);
  73.     virtual Handle         CopyTextRange( long start, long end);
  74.     virtual void         PerformEditCommand( long theCommand);
  75.     virtual void         InsertTextPtr( Ptr text, long length, Boolean fRedraw);
  76.  
  77.  
  78. private:
  79.  
  80.     virtual void        SetFontStuff(void);
  81.     virtual void        CalcLineStarts(void);
  82.     virtual long         indexToLine(long selIndex);
  83.  
  84.     LongPt                frame_origin;
  85.     short                    lineHeight;
  86.     short                    fontAscent;
  87.     long                teLength;
  88.     Handle                hText;
  89.     short                    txFont;
  90.     char                txFace;
  91.     short                    txMode;
  92.     short                    txSize;
  93.     short                    tabWidth;
  94.     long                nLines;
  95.     short                    theCharWidths[256];
  96.     long                **lineStarts;
  97. };
  98.